Skip to main content
POST
/
media_library
Upload media library file
curl --request POST \
  --url https://your_a2_service/media_library \
  --header 'Content-Type: multipart/form-data' \
  --form 'cdn_host=<string>' \
  --form file_size=123 \
  --form height=123 \
  --form 'mime=<string>' \
  --form owner_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
  --form 'storage=<string>' \
  --form width=123 \
  --form file=@example-file
{
  "cdn_path": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "file_size": 123,
  "filename": "<string>",
  "height": 123,
  "mime": "<string>",
  "no": 123,
  "path": "<string>",
  "storage": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "width": 123
}

Body

multipart/form-data
cdn_host
string
required

The base URL of the CDN where the media will be accessible

file
file
required

The media file to be uploaded to the library

file_size
integer
required

The size of the file in bytes

height
integer
required

The height of the media in pixels

mime
string
required

The MIME type of the media file (e.g., image/jpeg, video/mp4)

owner_id
string<uuid>
required

The owner's id of media library

storage
string
required

The storage backend where the media will be stored. Supported values: 'fs' (filesystem) or 'aws' (Amazon Web Services)

width
integer
required

The width of the media in pixels

Response

Successful Response

Schema for reading media library entity.

cdn_path
string
required

The CDN url from which the media can be accessed

file_size
integer
required

The file size of the media

filename
string
required

The filename of media library

height
integer
required

The height of the media

mime
string
required

The mime-type of the media

no
integer
required

The no of media library

path
string
required

Relative paths stored in the storage

storage
string
required

The storage type where the media is stored

user_id
string<uuid>
required

The owner's id of media library

width
integer
required

The width of the media

created_at
string<date-time> | null

The date and time the entity was created.

updated_at
string<date-time> | null

The date and time the entity was last updated.